package com.qiangqiang.task.server.mapper;

import com.qiangqiang.task.server.entity.Comments;
import com.qiangqiang.task.server.entity.Post;
import com.qiangqiang.task.server.mapper.provider.CommentsProvider;
import com.qiangqiang.task.server.mapper.provider.PostMapperProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @program: task
 * @description:
 * @author: Sky.lin
 * @create: 2018-12-27 16:24
 **/
@Mapper
public interface CommentsMapper {

    @InsertProvider(type = CommentsProvider.class,method = "insertComments")
    int insertComments(@Param("comments") Comments comments);

    @SelectProvider(type = CommentsProvider.class,method = "queryAllComments")
    List<Comments> queryAllPost(@Param("page") int page, @Param("pageSize") int pageSize,@Param("postId")long postId);
}
